
#ifndef COLORPICKER_H
#define COLORPICKER_H

#include <BCursor>
#include <BCircle>

#include "Operation.h"

class ColorPicker : public Operation
{
public:
	ColorPicker();
	~ColorPicker();

protected:
	virtual void attached(BWidget* widget);
	virtual void detached(BWidget* widget);

	virtual void paint(BPainter& painter);

	virtual void freshEvent(const BEvent& event);

	virtual bool focusEvent(const BEvent& event);
	virtual bool keyDownEvent(const BKeyEvent& keyEvent);
	virtual bool keyUpEvent(const BKeyEvent& keyEvent);

	virtual bool mouseEnterEvent(const BMouseEvent& mouseEvent);
	virtual bool mouseLeaveEvent(const BMouseEvent& mouseEvent);
	virtual bool mousePressEvent(const BMouseEvent& mouseEvent);
	virtual bool mouseReleaseEvent(const BMouseEvent& mouseEvent);
	virtual bool mouseMoveEvent(const BMouseEvent& mouseEvent);

private:
	BCursorHolder	_cursor;
	bool			_pressed;
	BPoint			_pressPoint;
	BRect			_pickRect;
	BColor			_pickColor;
	BPoint			_point;
};

#endif
